﻿<%@ Page Title="" Language="VB" MasterPageFile="~/Admin/Site.master" AutoEventWireup="false" CodeFile="~/Admin_Category_insertCategory.vb" Inherits="~/Admin_Category_insertCategory" %>


<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" Runat="Server">
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" Runat="Server">
    &nbsp;<br />
    
    
    <h1>
        add new
        category page</h1>
        <div >
        
            <asp:ListView ID="ListView1" runat="server" DataKeyNames="ID" 
                DataSourceID="SqlDataSource1">
                <ItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                        </td>
                        <td>
                            <asp:Label ID="CatNameLabel" runat="server" Text='<%# Eval("CatName") %>' />
                        </td>
                        <td>
                            <asp:Label ID="DescirptionLabel" runat="server" 
                                Text='<%# Eval("Descirption") %>' />
                        </td>
                    </tr>
                </ItemTemplate>
                <AlternatingItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                        </td>
                        <td>
                            <asp:Label ID="CatNameLabel" runat="server" Text='<%# Eval("CatName") %>' />
                        </td>
                        <td>
                            <asp:Label ID="DescirptionLabel" runat="server" 
                                Text='<%# Eval("Descirption") %>' />
                        </td>
                    </tr>
                </AlternatingItemTemplate>
                <EmptyDataTemplate>
                    <table runat="server" style="">
                        <tr>
                            <td>
                                No data was returned.</td>
                        </tr>
                    </table>
                </EmptyDataTemplate>
                <InsertItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="InsertButton" runat="server" CommandName="Insert" 
                                Text="Insert" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                Text="Clear" />
                        </td>
                        <td>
                            &nbsp;</td>
                        <td>
                            <asp:TextBox ID="CatNameTextBox" runat="server" Text='<%# Bind("CatName") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="DescirptionTextBox" runat="server" 
                                Text='<%# Bind("Descirption") %>' />
                        </td>
                    </tr>
                </InsertItemTemplate>
                <LayoutTemplate>
                    <table runat="server">
                        <tr runat="server">
                            <td runat="server">
                                <table ID="itemPlaceholderContainer" runat="server" border="0" style="">
                                    <tr runat="server" style="">
                                        <th runat="server">
                                            ID</th>
                                        <th runat="server">
                                            CatName</th>
                                        <th runat="server">
                                            Descirption</th>
                                    </tr>
                                    <tr ID="itemPlaceholder" runat="server">
                                    </tr>
                                </table>
                            </td>
                        </tr>
                        <tr runat="server">
                            <td runat="server" style="">
                                <asp:DataPager ID="DataPager1" runat="server">
                                    <Fields>
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowFirstPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                        <asp:NumericPagerField />
                                        <asp:NextPreviousPagerField ButtonType="Button" ShowLastPageButton="True" 
                                            ShowNextPageButton="False" ShowPreviousPageButton="False" />
                                    </Fields>
                                </asp:DataPager>
                            </td>
                        </tr>
                    </table>
                </LayoutTemplate>
                <EditItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Button ID="UpdateButton" runat="server" CommandName="Update" 
                                Text="Update" />
                            <asp:Button ID="CancelButton" runat="server" CommandName="Cancel" 
                                Text="Cancel" />
                        </td>
                        <td>
                            <asp:Label ID="IDLabel1" runat="server" Text='<%# Eval("ID") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="CatNameTextBox" runat="server" Text='<%# Bind("CatName") %>' />
                        </td>
                        <td>
                            <asp:TextBox ID="DescirptionTextBox" runat="server" 
                                Text='<%# Bind("Descirption") %>' />
                        </td>
                    </tr>
                </EditItemTemplate>
                <SelectedItemTemplate>
                    <tr style="">
                        <td>
                            <asp:Label ID="IDLabel" runat="server" Text='<%# Eval("ID") %>' />
                        </td>
                        <td>
                            <asp:Label ID="CatNameLabel" runat="server" Text='<%# Eval("CatName") %>' />
                        </td>
                        <td>
                            <asp:Label ID="DescirptionLabel" runat="server" 
                                Text='<%# Eval("Descirption") %>' />
                        </td>
                    </tr>
                </SelectedItemTemplate>
            </asp:ListView>
            <asp:SqlDataSource ID="SqlDataSource1" runat="server" 
                ConnectionString="Provider=Microsoft.ACE.OLEDB.12.0;Data Source=&quot;C:\Users\T M HUSMAN\Documents\Visual Studio 2008\Projects\WebApplication11(7)\App_Data\pictures1.accdb&quot;" 
                ProviderName="System.Data.OleDb" 
                SelectCommand="SELECT [ID], [CatName], [Descirption] FROM [Categories]">
            </asp:SqlDataSource>
        
        </div>
        <div> 
        <h3> ADD NEW CATEGORY  </h3>
            <p> <asp:Label ID="Label1" runat="server" Text="Category"></asp:Label>
                <asp:TextBox ID="CatName" runat="server"></asp:TextBox>
            </p>
            <p> 
                <asp:Label ID="Label2" runat="server" Text="Description:"></asp:Label>
                <asp:TextBox ID="Description" runat="server"></asp:TextBox>
            </p>
            <p> 
                <asp:Button ID="AddBtn" runat="server" Text="Add" onclick="AddBtn_Click" 
                    Width="112px" />
            </p>
           
            <p> </p>
        
        </div>
</asp:Content>

